cmake_minimum_required(VERSION 3.18)
if (POLICY CMP0141)
    cmake_policy(SET CMP0141 NEW)
    set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<AND:$<C_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:MSVC>>,$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>,$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>>")
endif()

if (MSVC)
    add_compile_options($<$<CXX_COMPILER_ID:MSVC>:/utf-8>)
    add_compile_options(/w)  # 禁用所有警告
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
    add_compile_options(-w)
endif ()

project(CuDGGS CUDA CXX)

set(CMAKE_OUT_DIR ${CMAKE_SOURCE_DIR})
set(lib_output_directory ${CMAKE_OUT_DIR}/out)
set(lib_output_lib_directory ${lib_output_directory}/lib)
set(lib_output_bin_directory ${lib_output_directory}/bin)
set(lib_output_include_directory ${lib_output_directory}/include)
file(MAKE_DIRECTORY ${lib_output_lib_directory})
file(MAKE_DIRECTORY ${lib_output_bin_directory})
file(MAKE_DIRECTORY ${lib_output_include_directory})

add_subdirectory("CuLibDGGSKernel")
add_subdirectory("CuFieldTranslate")